import grails.util.GrailsUtil
import org.codehaus.groovy.grails.commons.GrailsApplication


class BootStrap {
  def fixtureLoader

  def init = { servletContext ->
    if (GrailsUtil.environment == GrailsApplication.ENV_DEVELOPMENT) {
      fixtureLoader.load("dev")
    }

    // addining another static method to Date class
    Date.metaClass.'static'.parseOrNull = { dateString ->
      try{ 
	return Date.parse("yyyy-MM-dd", dateString)
      }catch(java.text.ParseException e){}
      return null
    }
  }

  def destroy = {
  }
} 
